home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Form1
- BackColor = &H00C0C0C0&
- Caption = "Get MEDIA ID (Serial Number, Volume Label, ...)"
- ClientHeight = 6030
- ClientLeft = 945
- ClientTop = 1365
- ClientWidth = 6765
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 6375
- Left = 915
- LinkTopic = "Form1"
- ScaleHeight = 6030
- ScaleWidth = 6765
- Top = 1050
- Width = 6825
- Begin ListBox List2
- Height = 225
- Left = 90
- TabIndex = 1
- Top = 540
- Width = 6585
- End
- Begin SSPanel Panel3D2
- AutoSize = 3 'AutoSize Child To Panel
- BevelOuter = 1 'Inset
- Height = 5130
- Left = 90
- TabIndex = 4
- Top = 810
- Width = 6585
- Begin ListBox List1
- Height = 5100
- Left = 15
- TabIndex = 2
- Top = 15
- Width = 6555
- End
- End
- Begin SSPanel Panel3D1
- AutoSize = 3 'AutoSize Child To Panel
- BevelOuter = 1 'Inset
- Height = 375
- Left = 90
- TabIndex = 3
- Top = 90
- Width = 1725
- Begin CommandButton Command1
- Caption = "&Get Media ID"
- Height = 345
- Left = 15
- TabIndex = 0
- Top = 15
- Width = 1695
- End
- End
- Option Explicit
- Sub Command1_Click ()
- Dim i As Integer
- Dim status As Integer
- Dim disk As String
- Dim MEDIAID As tagMEDIAID
- ' clear all list boxes
- List1.Clear
- List2.Clear
- ' add title
- List2.AddItem "Disk" & Chr$(9) & "Serial Number" & Chr$(9) & "Volume Label" & Chr$(9) & "FAT type"
- ' process all disks 'A' - 'Z'
- For i = 1 To 26
- ' get drive letter
- disk = Chr$(64 + i)
- ' get the media ID
- status = cDOSGetMediaID(disk, MEDIAID)
- ' check if the media ID exist
- If (status = True) Then
- ' yes, add it in the list
- List1.AddItem Chr$(64 + i) & Chr$(9) & Right$("00000000" + Hex$(MEDIAID.SerialNumber), 8) & Chr$(9) & MEDIAID.VolLabel & Chr$(9) & MEDIAID.FileSysType
- Else
- ' no, add 'no media id'
- List1.AddItem disk & Chr$(9) & Chr$(9) & Chr$(9) & Chr$(9) & Chr$(9) & Chr$(9) & "no media id"
- End If
- Next i
- End Sub
-